/* 小米风格后台管理系统样式 */

:root {
    /* 小米橙色主题色 */
    --xiaomi-orange: #ff6900;
    --xiaomi-orange-light: #ff7f24;
    --xiaomi-orange-dark: #e55a00;
    
    /* 小米蓝色 */
    --xiaomi-blue: #2196f3;
    --xiaomi-blue-light: #42a5f5;
    --xiaomi-blue-dark: #1976d2;
    
    /* 小米绿色 */
    --xiaomi-green: #4caf50;
    --xiaomi-green-light: #66bb6a;
    --xiaomi-green-dark: #388e3c;
    
    /* 小米红色 */
    --xiaomi-red: #f44336;
    --xiaomi-red-light: #ef5350;
    --xiaomi-red-dark: #d32f2f;
    
    /* 中性色 */
    --xiaomi-gray-50: #fafafa;
    --xiaomi-gray-100: #f5f5f5;
    --xiaomi-gray-200: #eeeeee;
    --xiaomi-gray-300: #e0e0e0;
    --xiaomi-gray-400: #bdbdbd;
    --xiaomi-gray-500: #9e9e9e;
    --xiaomi-gray-600: #757575;
    --xiaomi-gray-700: #616161;
    --xiaomi-gray-800: #424242;
    --xiaomi-gray-900: #212121;
    
    /* 阴影 */
    --xiaomi-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --xiaomi-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --xiaomi-shadow-focus: 0 0 0 3px rgba(255, 105, 0, 0.2);
    
    /* 圆角 */
    --xiaomi-radius: 8px;
    --xiaomi-radius-lg: 12px;
    --xiaomi-radius-sm: 4px;
    
    /* 过渡 */
    --xiaomi-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 主题基础样式 */
.xiaomi-theme {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", "WenQuanYi Micro Hei", sans-serif;
    background-color: var(--xiaomi-gray-50);
    color: var(--xiaomi-gray-800);
    line-height: 1.6;
}

/* 顶部导航栏 */
.xiaomi-navbar {
    background: linear-gradient(135deg, var(--xiaomi-orange) 0%, var(--xiaomi-orange-dark) 100%);
    box-shadow: var(--xiaomi-shadow);
    border: none;
    height: 64px;
    padding: 0;
}

.xiaomi-brand {
    display: flex;
    align-items: center;
    color: white !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--xiaomi-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 20px;
}

.brand-icon {
    width: 40px;
    height: 40px;
   
}

.xiaomi-nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 8px 12px;
    border-radius: var(--xiaomi-radius-sm);
    transition: var(--xiaomi-transition);
    position: relative;
}

.xiaomi-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 16px;
}

.xiaomi-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    font-size: 10px;
    line-height: 16px;
    padding: 0 4px;
}

.xiaomi-dropdown {
    border: none;
    box-shadow: var(--xiaomi-shadow-hover);
    border-radius: var(--xiaomi-radius);
    padding: 8px 0;
    margin-top: 8px;
}

.xiaomi-dropdown .dropdown-item {
    padding: 8px 16px;
    transition: var(--xiaomi-transition);
}

.xiaomi-dropdown .dropdown-item:hover {
    background-color: var(--xiaomi-gray-100);
    color: var(--xiaomi-orange);
}

/* 主容器布局 */
.xiaomi-admin-container {
    display: flex;
    min-height: calc(100vh - 64px);
    margin-top: 64px;
}

/* 侧边栏 */
.xiaomi-sidebar {
    width: 260px;
    background: white;
    box-shadow: var(--xiaomi-shadow);
    z-index: 1000;
    position: fixed;
    height: calc(100vh - 64px);
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--xiaomi-gray-200);
}

.sidebar-title {
    color: var(--xiaomi-gray-700);
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    padding: 16px 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--xiaomi-gray-600);
    text-decoration: none;
    transition: var(--xiaomi-transition);
    border: none;
    background: none;
    font-size: 14px;
    margin: 2px 12px;
    border-radius: var(--xiaomi-radius);
}

.sidebar-nav .nav-link i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
}

.sidebar-nav .nav-link:hover {
    background-color: var(--xiaomi-gray-100);
    color: var(--xiaomi-orange);
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, var(--xiaomi-orange), var(--xiaomi-orange-light));
    color: white;
    box-shadow: var(--xiaomi-shadow);
}

/* 主内容区域 */
.xiaomi-main-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px;
    background-color: var(--xiaomi-gray-50);
    min-height: calc(100vh - 64px);
}

/* 内容区域切换 */
.content-section {
    display: none;
    animation: fadeInUp 0.3s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 页面头部 */
.xiaomi-page-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--xiaomi-gray-200);
}

.page-title {
    color: var(--xiaomi-gray-800);
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.page-subtitle {
    color: var(--xiaomi-gray-600);
    font-size: 14px;
    margin: 0;
}

/* 卡片样式 */
.xiaomi-card {
    background: white;
    border-radius: var(--xiaomi-radius-lg);
    box-shadow: var(--xiaomi-shadow);
    border: none;
    transition: var(--xiaomi-transition);
    overflow: hidden;
}

.xiaomi-card:hover {
    box-shadow: var(--xiaomi-shadow-hover);
    transform: translateY(-2px);
}

.xiaomi-card .card-header {
    background: var(--xiaomi-gray-50);
    border-bottom: 1px solid var(--xiaomi-gray-200);
    padding: 16px 20px;
}

.xiaomi-card .card-title {
    color: var(--xiaomi-gray-800);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.xiaomi-card .card-body {
    padding: 20px;
}

/* 统计卡片 */
.xiaomi-stat-card {
    background: white;
    border-radius: var(--xiaomi-radius-lg);
    padding: 24px;
    box-shadow: var(--xiaomi-shadow);
    transition: var(--xiaomi-transition);
    border-left: 4px solid;
    position: relative;
    overflow: hidden;
}

.xiaomi-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    opacity: 0.1;
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.xiaomi-stat-card.orange {
    border-left-color: var(--xiaomi-orange);
}

.xiaomi-stat-card.orange::before {
    background: var(--xiaomi-orange);
}

.xiaomi-stat-card.blue {
    border-left-color: var(--xiaomi-blue);
}

.xiaomi-stat-card.blue::before {
    background: var(--xiaomi-blue);
}

.xiaomi-stat-card.green {
    border-left-color: var(--xiaomi-green);
}

.xiaomi-stat-card.green::before {
    background: var(--xiaomi-green);
}

.xiaomi-stat-card.red {
    border-left-color: var(--xiaomi-red);
}

.xiaomi-stat-card.red::before {
    background: var(--xiaomi-red);
}

.xiaomi-stat-card:hover {
    box-shadow: var(--xiaomi-shadow-hover);
    transform: translateY(-4px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--xiaomi-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 16px;
}

.xiaomi-stat-card.orange .stat-icon {
    background: var(--xiaomi-orange);
}

.xiaomi-stat-card.blue .stat-icon {
    background: var(--xiaomi-blue);
}

.xiaomi-stat-card.green .stat-icon {
    background: var(--xiaomi-green);
}

.xiaomi-stat-card.red .stat-icon {
    background: var(--xiaomi-red);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--xiaomi-gray-800);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--xiaomi-gray-600);
    font-weight: 500;
}

/* 快速操作卡片 */
.quick-action-card {
    background: white;
    border-radius: var(--xiaomi-radius);
    padding: 20px;
    border: 1px solid var(--xiaomi-gray-200);
    transition: var(--xiaomi-transition);
    cursor: pointer;
    height: 100%;
    display: flex;
    align-items: center;
}

.quick-action-card:hover {
    border-color: var(--xiaomi-orange);
    box-shadow: var(--xiaomi-shadow);
    transform: translateY(-2px);
}

.action-icon {
    width: 48px;
    height: 48px;
    background: var(--xiaomi-gray-100);
    border-radius: var(--xiaomi-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--xiaomi-orange);
    margin-right: 16px;
    transition: var(--xiaomi-transition);
}

.quick-action-card:hover .action-icon {
    background: var(--xiaomi-orange);
    color: white;
}

.action-content h6 {
    color: var(--xiaomi-gray-800);
    font-weight: 600;
    margin: 0 0 4px 0;
    font-size: 14px;
}

.action-content p {
    color: var(--xiaomi-gray-600);
    font-size: 12px;
    margin: 0;
}

/* 活动列表 */
.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--xiaomi-gray-100);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-right: 12px;
    color: white;
}

.activity-icon.success {
    background: var(--xiaomi-green);
}

.activity-icon.info {
    background: var(--xiaomi-blue);
}

.activity-icon.warning {
    background: var(--xiaomi-orange);
}

.activity-icon.error {
    background: var(--xiaomi-red);
}

.activity-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--xiaomi-gray-800);
    margin-bottom: 2px;
}

.activity-time {
    font-size: 12px;
    color: var(--xiaomi-gray-500);
}

/* 表单控件 */
.xiaomi-select {
    border: 1px solid var(--xiaomi-gray-300);
    border-radius: var(--xiaomi-radius);
    padding: 8px 12px;
    font-size: 14px;
    transition: var(--xiaomi-transition);
    background: white;
}

.xiaomi-select:focus {
    border-color: var(--xiaomi-orange);
    box-shadow: var(--xiaomi-shadow-focus);
    outline: none;
}

/* 文件上传区域 */
.xiaomi-upload-area {
    border: 2px dashed var(--xiaomi-gray-300);
    border-radius: var(--xiaomi-radius-lg);
    padding: 40px 20px;
    text-align: center;
    background: var(--xiaomi-gray-50);
    transition: var(--xiaomi-transition);
    cursor: pointer;
}

.xiaomi-upload-area:hover {
    border-color: var(--xiaomi-orange);
    background: var(--xiaomi-orange);
    background: linear-gradient(135deg, rgba(255, 105, 0, 0.05), rgba(255, 105, 0, 0.1));
}

.xiaomi-upload-area.dragover {
    border-color: var(--xiaomi-orange);
    background: rgba(255, 105, 0, 0.1);
    transform: scale(1.02);
}

/* 文件信息卡片 */
.xiaomi-file-info {
    background: var(--xiaomi-blue);
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(33, 150, 243, 0.05));
    border: 1px solid rgba(33, 150, 243, 0.2);
    border-radius: var(--xiaomi-radius);
    padding: 16px;
}

/* 按钮样式 */
.xiaomi-btn-primary {
    background: linear-gradient(135deg, var(--xiaomi-orange), var(--xiaomi-orange-light));
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: var(--xiaomi-radius);
    font-weight: 500;
    transition: var(--xiaomi-transition);
    box-shadow: var(--xiaomi-shadow);
}

.xiaomi-btn-primary:hover {
    background: linear-gradient(135deg, var(--xiaomi-orange-dark), var(--xiaomi-orange));
    box-shadow: var(--xiaomi-shadow-hover);
    transform: translateY(-1px);
    color: white;
}

.xiaomi-btn-danger {
    background: var(--xiaomi-red);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: var(--xiaomi-radius-sm);
    transition: var(--xiaomi-transition);
}

.xiaomi-btn-danger:hover {
    background: var(--xiaomi-red-dark);
    color: white;
}

/* 进度条 */
.xiaomi-progress {
    height: 6px;
    border-radius: 3px;
    background: var(--xiaomi-gray-200);
    overflow: hidden;
}

.xiaomi-progress .progress-bar {
    background: linear-gradient(90deg, var(--xiaomi-orange), var(--xiaomi-orange-light));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* 表格容器 */
.xiaomi-table-container {
    border: 1px solid var(--xiaomi-gray-200);
    border-radius: var(--xiaomi-radius);
    background: white;
}

.xiaomi-table-container table {
    margin: 0;
}

.xiaomi-table-container .table th {
    background: var(--xiaomi-gray-50);
    border-top: none;
    border-bottom: 1px solid var(--xiaomi-gray-200);
    font-weight: 600;
    color: var(--xiaomi-gray-700);
    font-size: 14px;
    padding: 12px;
}

.xiaomi-table-container .table td {
    border-top: 1px solid var(--xiaomi-gray-100);
    font-size: 14px;
    padding: 12px;
    color: var(--xiaomi-gray-800);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .xiaomi-sidebar {
        width: 100%;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .xiaomi-sidebar.show {
        transform: translateX(0);
    }
    
    .xiaomi-main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .xiaomi-stat-card {
        margin-bottom: 16px;
    }
    
    .quick-action-card {
        margin-bottom: 12px;
    }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .xiaomi-theme {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .xiaomi-card {
        background: #2d2d2d;
        border-color: #404040;
    }
    
    .xiaomi-sidebar {
        background: #2d2d2d;
        border-color: #404040;
    }
}

/* 加载动画 */
.xiaomi-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--xiaomi-gray-300);
    border-radius: 50%;
    border-top-color: var(--xiaomi-orange);
    animation: xiaomi-spin 0.8s linear infinite;
}

@keyframes xiaomi-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 工具提示 */
.xiaomi-tooltip {
    background: var(--xiaomi-gray-800);
    color: white;
    padding: 4px 8px;
    border-radius: var(--xiaomi-radius-sm);
    font-size: 12px;
    box-shadow: var(--xiaomi-shadow);
}

/* 徽章 */
.xiaomi-badge-orange {
    background: var(--xiaomi-orange);
    color: white;
}

.xiaomi-badge-blue {
    background: var(--xiaomi-blue);
    color: white;
}

.xiaomi-badge-green {
    background: var(--xiaomi-green);
    color: white;
}

.xiaomi-badge-red {
    background: var(--xiaomi-red);
    color: white;
}

/* API测试页面样式 */
.api-endpoint-card {
    background: white;
    border-radius: var(--xiaomi-radius);
    padding: 16px;
    border: 1px solid var(--xiaomi-gray-200);
    transition: var(--xiaomi-transition);
    height: 100%;
    position: relative;
}

.api-endpoint-card:hover {
    box-shadow: var(--xiaomi-shadow-hover);
    transform: translateY(-2px);
}

.api-method {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.api-method.get {
    background: var(--xiaomi-green);
    color: white;
}

.api-method.post {
    background: var(--xiaomi-orange);
    color: white;
}

.api-method.file {
    background: var(--xiaomi-blue);
    color: white;
}

.api-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--xiaomi-gray-800);
    margin: 8px 0 4px 0;
}

.api-url {
    font-size: 11px;
    color: var(--xiaomi-gray-600);
    font-family: monospace;
    background: var(--xiaomi-gray-100);
    padding: 2px 6px;
    border-radius: 3px;
    margin: 4px 0;
    word-break: break-all;
}

.api-desc {
    font-size: 12px;
    color: var(--xiaomi-gray-600);
    margin: 8px 0 12px 0;
    line-height: 1.4;
}

.response-display {
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    background: var(--xiaomi-gray-50);
    border-radius: var(--xiaomi-radius);
    padding: 16px;
}

.response-display pre {
    background: white;
    border: 1px solid var(--xiaomi-gray-200);
    border-radius: var(--xiaomi-radius);
    padding: 12px;
    font-size: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

/* 数据处理页面样式 */
.process-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    opacity: 0.5;
    transition: var(--xiaomi-transition);
}

.step.active {
    opacity: 1;
}

.step.completed {
    opacity: 1;
}

.step-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--xiaomi-gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    color: white;
    font-size: 18px;
    transition: var(--xiaomi-transition);
}

.step.active .step-icon {
    background: var(--xiaomi-orange);
    box-shadow: 0 0 0 4px rgba(255, 103, 0, 0.2);
}

.step.completed .step-icon {
    background: var(--xiaomi-green);
}

.step.completed .step-icon::before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}

.step-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--xiaomi-gray-600);
    text-align: center;
    min-width: 80px;
}

.step.active .step-text {
    color: var(--xiaomi-orange);
    font-weight: 600;
}

.step.completed .step-text {
    color: var(--xiaomi-green);
    font-weight: 600;
}

.step-line {
    width: 100px;
    height: 2px;
    background: var(--xiaomi-gray-300);
    margin: 0 20px;
    position: relative;
    top: -25px;
}

.step.completed + .step-line {
    background: var(--xiaomi-green);
}

/* 上传区域样式 */
.upload-area {
    border: 2px dashed var(--xiaomi-gray-300);
    border-radius: var(--xiaomi-radius);
    padding: 40px;
    text-align: center;
    background: var(--xiaomi-gray-50);
    transition: var(--xiaomi-transition);
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--xiaomi-orange);
    background: rgba(255, 103, 0, 0.05);
}

.upload-area.drag-over {
    border-color: var(--xiaomi-orange);
    background: rgba(255, 103, 0, 0.1);
    border-style: solid;
}

.upload-content i {
    color: var(--xiaomi-gray-400);
}

.upload-area:hover .upload-content i {
    color: var(--xiaomi-orange);
}

/* 上传提示样式 */
.upload-tips h6 {
    color: var(--xiaomi-gray-700);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.upload-tips ul {
    font-size: 13px;
    color: var(--xiaomi-gray-600);
    line-height: 1.5;
}

.upload-tips li {
    margin-bottom: 4px;
}

/* 转换日志样式 */
.log-entry {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
}

.log-entry.log-info {
    background: rgba(52, 152, 219, 0.1);
    border-left: 3px solid var(--xiaomi-blue);
}

.log-entry.log-success {
    background: rgba(39, 174, 96, 0.1);
    border-left: 3px solid var(--xiaomi-green);
}

.log-entry.log-error {
    background: rgba(231, 76, 60, 0.1);
    border-left: 3px solid var(--xiaomi-red);
}

.log-time {
    font-size: 11px;
    min-width: 60px;
    font-family: monospace;
}

.log-icon {
    min-width: 16px;
}

.log-icon .fa-check {
    color: var(--xiaomi-green);
}

.log-icon .fa-times {
    color: var(--xiaomi-red);
}

.log-icon .fa-info {
    color: var(--xiaomi-blue);
}

/* 统计数据样式 */
.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--xiaomi-gray-600);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 下载文件项样式 */
.download-file-item {
    transition: var(--xiaomi-transition);
}

.download-file-item:hover {
    transform: translateY(-1px);
}

.download-file-item .border {
    border-color: var(--xiaomi-gray-200) !important;
    transition: var(--xiaomi-transition);
}

.download-file-item:hover .border {
    border-color: var(--xiaomi-orange) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}